class Cache(object):
    def __init__(self, max_hits=10, timeout=5):
        # Remove function from here and add it to the __call__
        self.max_hits = max_hits
        self.timeout = timeout
        self.cache = {}

    def __call__(self, function):
        def wrapper(*args, **kwargs):
            value = function(*args, **kwargs)
            # saving to cache codes
            return value
        return wrapper

@Cache()
def double1(x):
    return x * 2

@Cache(max_hits=100, timeout=50)
def double2(x):
    return x * 2

if __name__ == '__main__':
    double1(1)
    double2(2)
